function msg_using_pocs = pocs(x)


onebit=7; %number of samples per bit
z=(length(x))/onebit; %number of bits transmitted
b=onebit;
c=1;
K=7;
H=[];
Y=[];
G = sqrt(K+1);
g=1;
msg_using_pocs = [];
j= sqrt(-1);
c_bar = [];
xl = [];

for m=1:z %iteration from 1 to number of bits
    y=x(c:b); % take the needed signal for one bit
    
    
    for n=1:onebit
        Htemp=0;
        for k=1:onebit
          Htemp = Htemp + y(k)*exp((-2*pi*j*(n-1)*(k-1))/K);
        end
        H = [H Htemp];
        
        if abs(H(n))<=G
            Y(n) = H(n);
        else if abs(H(n))>G;
                Y(n)=(G*H(n)/abs(H(n)));
            else
                Y(n)=0;
            end
        end
    end      
    
    for n=1:onebit
        c_bartemp=0;
        for k=1:onebit
          c_bartemp = c_bartemp + Y(k)*exp((-2*pi*j*(n-1)*(k-1))/K);
        end
        c_bar = [c_bar abs(c_bartemp)];
    end
    
    l=0;
    for n=1:onebit
        xl(n) = 1;
        xl=c_bar';
    end
    
   msg_using_pocs = [msg_using_pocs c_bar]; 
   b=b+onebit; %update the value of b for the next input
   c=c+onebit; %update the value of c for the next input

end